package com.hejr.test02.mapper;

import com.hejr.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface UserMapperTest02 {

	/**
	 * 按姓名查询
	 * @param name
	 * @return
	 */
	@Select("SELECT * FROM TB_USER WHERE NAME = #{name}")
	User findByName(@Param("name") String name);

	/**
	 * 添加用户
	 * @param name
	 * @param age
	 * @return
	 */
	@Insert("INSERT INTO TB_USER(NAME, AGE) VALUES(#{name}, #{age})")
	int insert(@Param("name") String name, @Param("age") Integer age);
}
